import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '社区名称',
    align: "center",
    dataIndex: 'communityName'
  },
  {
    title: '房产编号',
    align: "center",
    dataIndex: 'propertyNumber'
  },
  {
    title: '业主姓名',
    align: "center",
    dataIndex: 'ownerName'
  },
  {
    title: '账期',
    align: "center",
    dataIndex: 'accountingPeriod',
    customRender:({text}) =>{
      return !text?"":(text.length>10?text.substr(0,10):text);
    },
  },
  {
    title: '卫生费',
    align: "center",
    dataIndex: 'publicSanitation'
  },
  {
    title: '物业费6折',
    align: "center",
    dataIndex: 'propertyManagementSix'
  },
  {
    title: '物业费',
    align: "center",
    dataIndex: 'propertyManagement'
  },
  {
    title: '管道加压费',
    align: "center",
    dataIndex: 'pipelinePressurizationfee'
  },
  {
    title: '车位服务费',
    align: "center",
    dataIndex: 'parkingServices'
  },
  {
    title: '水费',
    align: "center",
    dataIndex: 'water'
  },
  {
    title: '账单合计',
    align: "center",
    dataIndex: 'totalBill'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '社区名称',
    field: 'communityName',
    component: 'Input',
  },
  {
    label: '房产编号',
    field: 'propertyNumber',
    component: 'Input',
  },
  {
    label: '业主姓名',
    field: 'ownerName',
    component: 'Input',
  },
  {
    label: '账期',
    field: 'accountingPeriod',
    component: 'DatePicker',
  },
  {
    label: '卫生费',
    field: 'publicSanitation',
    component: 'InputNumber',
  },
  {
    label: '物业费6折',
    field: 'propertyManagementSix',
    component: 'InputNumber',
  },
  {
    label: '物业费',
    field: 'propertyManagement',
    component: 'InputNumber',
  },
  {
    label: '管道加压费',
    field: 'pipelinePressurizationfee',
    component: 'InputNumber',
  },
  {
    label: '车位服务费',
    field: 'parkingServices',
    component: 'InputNumber',
  },
  {
    label: '水费',
    field: 'water',
    component: 'InputNumber',
  },
  {
    label: '账单合计',
    field: 'totalBill',
    component: 'InputNumber',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

// 高级查询数据
export const superQuerySchema = {
  communityName: {title: '社区名称',order: 0,view: 'text', type: 'string',},
  propertyNumber: {title: '房产编号',order: 1,view: 'text', type: 'string',},
  ownerName: {title: '业主姓名',order: 2,view: 'text', type: 'string',},
  accountingPeriod: {title: '账期',order: 3,view: 'date', type: 'string',},
  publicSanitation: {title: '卫生费',order: 4,view: 'number', type: 'number',},
  propertyManagementSix: {title: '物业费6折',order: 5,view: 'number', type: 'number',},
  propertyManagement: {title: '物业费',order: 6,view: 'number', type: 'number',},
  pipelinePressurizationfee: {title: '管道加压费',order: 7,view: 'number', type: 'number',},
  parkingServices: {title: '车位服务费',order: 8,view: 'number', type: 'number',},
  water: {title: '水费',order: 9,view: 'number', type: 'number',},
  totalBill: {title: '账单合计',order: 10,view: 'number', type: 'number',},
};
